package cn.com.kisen.spring.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.com.kisen.spring.domain.User;
import cn.com.kisen.spring.service.UserService;

/**
 * @author jiangz
 *
 */
@RestController
public class HomeController {

    @Autowired
    private UserService userService;

    @RequestMapping("/loadById")
    User loadById(Long userId) {
        return userService.loadById(userId);
    }

    @RequestMapping("/deleteById")
    void deleteById(Long userId) {
        userService.deleteById(userId);
    }

    @RequestMapping("/save")
    User save(User user) {
        return userService.save(user);
    }

    @RequestMapping("/update")
    User update(User user) {
        return userService.update(user);
    }
}